package com.penghk.springbootdemo.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

@Controller
public class HelloController {

    @Value("${com.didispace.blog.name}")
    private String name;

    @Value("${com.didispace.blog.title}")
    private String title;

    @Value("com.d")
    private String title2;

    @Value("${com.didispace.blog.number}")
    private int in ;

    //线程安全的map
    static Map<String , String> users = Collections.synchronizedMap(new HashMap<String , String>());

    @RequestMapping("/hel")
    public @ResponseBody String getHel() {
        return "hello";
    }

    @RequestMapping("/hello")
    public  String getHello() {
        return "hello";
    }

//    @RequestMapping("/")
//    public String index() {
//        return "index";
//    }

    @RequestMapping("/login")
    public String login() {
        return "login";
    }

    @RequestMapping(value = "login", method = RequestMethod.POST)
    public String loginin() {
        return "hello";
    }


}
